home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- // Copyright (C) 1997-2001 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 16 Feb 1999
- //
- //
- //
- // Description:
- // This implements the "Display" menu on the main menubar.
- //
-
-
- // Helper procs. these are approxomately in the same order the items are in the Display menu
-
- // global proc gridMenuUpdate() {
- // //
- // // This is called when a "gridDisplayChanged" event is detected.
- // // Update the menu item, the option var and the gShowGrid variable.
- // //
- // if( `menuItem -exists dispGridItem` ) {
- // menuItem -e -cb `grid -q -tgl` dispGridItem;
- // }
- // }
-
- // global proc viewAxesMenuUpdate() {
- // //
- // // This is called when a "viewAxesDisplayChanged" event is detected.
- // // Update the menu item, the option var and the gToggleViewAxis variable.
- // //
- // if( `menuItem -exists viewAxesItem` ) {
- // menuItem -e -cb `toggleAxis -q -v` viewAxesItem;
- // }
- // }
-
- // global proc originAxesMenuUpdate() {
- // //
- // // This is called when a "originAxesDisplayChanged" event is detected.
- // // Update the menu item, the option var and the gToggleOriginAxis variable.
- // //
- // if( `menuItem -exists originAxesItem` ) {
- // menuItem -e -cb `toggleAxis -q -o` originAxesItem;
- // }
- // }
-
- // Moved to brushToolSettings.mel
- //global proc brushToolSettings(){
- // if ( !`window -exists PaintEffectsBrushWindow` ){
- //
- // window
- // -t "Paint Effects Brush Settings"
- // -width 510 -height 600
- // PaintEffectsBrushWindow;
- //
- // // string $lName = `frameLayout -bv 0 -cl 0 -cll 0 -lv 0`;
- // string $cmd = "getDefaultBrush( )";
- // string $defName = `eval $cmd`;
- //
- // string $lName = `paneLayout`;
- //
- // createEditor $lName $defName;
- //
- // setParent ..;
- // frameLayout;
- // nameField -ncc ("brushNameCallback " + $lName) -o $defName;
- // }
- //
- // showWindow PaintEffectsBrushWindow;
- //}
-
- global proc creatorGlobalSettings(){
-
- if ( !`window -exists CreatorGlobalsWindow` ){
-
- window -t "Paint Effects Globals"
- -in "Paint Effects Globals"
- -width 510 -height 600
- CreatorGlobalsWindow;
-
- string $lName = `frameLayout -bv 0 -cl 0 -cll 0 -lv 0`;
-
- createEditor $lName "strokeGlobals";
- }
-
- showWindow CreatorGlobalsWindow;
- }
-
- global proc checkPresetBlend()
- {
- global string $presetBlendMenu;
- global int $gPresetBlending;
-
- if(`menuItem -q -cb presetBlendMenu`)
- {
- $gPresetBlending = 1;
- }
- else
- {
- $gPresetBlending = 0;
- if (`window -ex brushPresetBlendWnd`)
- {
- deleteUI -window brushPresetBlendWnd;
- }
-
- }
- }
-
- global proc changeTubeDirection()
- {
- int $attr;
- string $brush;
-
- $brush = getDefaultBrush();
- $attr = `getAttr($brush + ".tubeDirection")`;
- $attr = !$attr;
- setAttr ($brush + ".tubeDirection") $attr;
- }
-
- global proc buildCreatorMenu ( string $parent ) {
- //
- // Build the Creator menu. Checks to see if it's already
- // been built, and returns if this is true.
- //
- global string $gCreatorWireCtx;
- setParent -m $parent;
-
- global int $gPresetBlending;
- global string $presetBlendMenu;
- string $flipTubeDirMenu;
-
- int $doProject = 0;
-
- if ( `licenseCheck -m "edit" -typ "particlePaint"`) {
- $doProject = `dynWireCtx -q -dp $gCreatorWireCtx`;
- }
-
- string $editor = "There is no editor";
-
- if( `menu -q -ni $parent` == 0 ) {
-
- menuItem -label "Paint Effects Tool"
- -annotation "Paint Effects Tool: Draw strokes on paintable surfaces or the ground plane"
- -image "paintEffectsTool.xpm"
- -command "PaintEffectsTool";
- menuItem -optionBox true
- -annotation "Paint Effects Tool Option Box"
- -image "paintEffectsTool.xpm"
- -command "PaintEffectsToolOptions";
-
- if ( `licenseCheck -m "edit" -typ "particlePaint"`) {
- menuItem -label "Make Paintable"
- -annotation "Make Paintable: Make the selected surface(s) paintable, and other surfaces not paintable"
- -image "makePaintable.xpm"
- -command ("MakePaintable");
- }
-
- menuItem -d true;
-
- menuItem -label "Get Brush..."
- -annotation "Get Brush: Choose a Paint Effects Brush to paint with"
- -image "paintEffectsBrushesLarge.xpm"
- -command ("VisorWindow");
-
- menuItem -label "Template Brush Settings..."
- -annotation "Template Brush Settings: Edit the brush settings which will be applied to subsequent strokes"
- -image "templateBrushSettings.xpm"
- -command "TemplateBrushSettings";
- menuItem -label "Reset Template Brush"
- -annotation "Reset Template Brush: Reset the template brush attributes to their default values"
- -image "resetTemplateBrush.xpm"
- -command "ResetTemplateBrush";
-
- menuItem -label "Flip Tube Direction"
- -annotation "Flip the Tube Direction on the Current Brush"
- -image "flipTube.xpm"
- -command "changeTubeDirection" flipTubeDirMenu;
-
- menuItem -d true;
-
- if ( `licenseCheck -m "edit" -typ "particlePaint"`) {
- radioMenuItemCollection;
- menuItem -label "Paint on Paintable Objects"
- -radioButton ( $doProject )
- -annotation ("Paint on Paintable Objects: When on, project " +
- "strokes onto the paintable objects in the scene")
- -command ("PaintOnPaintableObjects");
- menuItem -label "Paint on View Plane"
- -radioButton ( !$doProject)
- -annotation ("Paint on View Plane: When on, project strokes onto the view"+
- " plane (Like a piece of glass in front of the camera)")
- -command ("PaintOnViewPlane");
-
- menuItem -d true;
- menuItem -label "Apply Settings to Last Stroke"
- -annotation ("Apply Settings to Last Stroke: Copy the current template brush settings "+
- "onto the most recently created stroke")
- -command "ApplySettingsToLastStroke";
- menuItem -label "Get Settings from Selected Stroke"
- -annotation "Get Settings from Selected Stroke: Copy the brush settings from the currently selected stroke to the template brush"
- -command "GetSettingsFromSelectedStroke";
- menuItem -label "Apply Settings to Selected Strokes"
- -annotation "Apply Settings to Selected Strokes: Copy the template brush settings to the currently selected strokes"
- -command "ApplySettingsToSelectedStroke";
- menuItem -d true;
- menuItem -label "Share One Brush"
- -annotation "Share One Brush: Cause selected strokes to share a common brush (so that editing the brush changes the appearance of all these strokes)"
- -command "ShareOneBrush";
- menuItem -label "Remove Brush Sharing"
- -annotation "Remove Brush Sharing: Give each selected stroke a unique brush (if it was previously sharing a brush)"
- -command "RemoveBrushSharing";
-
- menuItem -label "Select Brush/Stroke Names Containing..."
- -annotation "Select Brush/Stroke Names Containing: Select brushes/strokes whose name contains the specified characters"
- -command "SelectBrushNames";
-
- menuItem -d true;
-
- menuItem -l "Brush Animation" -subMenu true -aob true;
-
- menuItem -label "Loop Brush Animation"
- -annotation "Loop Brush Animation: Make the selected brush's animation loop seamlessly"
- -command "LoopBrushAnimation"
- -dmc "performLoopBrushAnim 2";// -i "iconName.xpm";
- menuItem -optionBox true -command "LoopBrushAnimationOptions";
-
- menuItem -label "Make Brush Spring"
- -annotation "Make Brush Spring: Add an expression simulating spring dynamics to the selected stroke(s)"
- -command "MakeBrushSpring"
- -dmc "performMakeBrushSpring 2";// -i "iconName.xpm";
- menuItem -optionBox true -command "MakeBrushSpringOptions";
-
- menuItem -label "Bake Spring Animation"
- -annotation "Bake Spring Animation: Create animation curves for any selected stroke(s) which had \"Make Brush Spring\" applied"
- -command "BakeSpringAnimation"
- -dmc "performBakeBrushSpringAnim 2";// -i "iconName.xpm";
- menuItem -optionBox true -command "BakeSpringAnimationOptions";
-
- setParent -m ..;
-
- menuItem -l "Curve Utilities" -subMenu true -aob true;
- menuItem -l "Simplify Stroke Path Curves"
- -annotation
- "Simplify Stroke Path Curves: Reduce the number of CVs in the selected stroke(s)"
- -c "SimplifyStrokePathCurves";
-
- menuItem -l "Set Stroke Control Curves"
- -annotation
- "Set Stroke Control Curves: Make selected curve(s) control the selected stroke(s) (see Curve Follow attribute)"
- -c "SetStrokeControlCurves";
-
- menuItem -label "Attach Brush to Curves"
- -annotation "Attach Brush to Curves: Create a new stroke using the selected curve(s) and the template brush"
- -command "AttachBrushToCurves";
-
- menuItem -label "Make Pressure Curve"
- -annotation "Make Pressure Curve: Create a curve to adjust brushstroke pressure values"
- -command "MakePressureCurve"
- -dmc "performMakePressureCurve 2";// -i "iconName.xpm";
- menuItem -optionBox true -command "MakePressureCurveOptions";
-
- setParent -m ..;
- menuItem -l "Auto Paint" -subMenu true -aob true;
- menuItem -l "Paint Grid"
- -annotation
- "Paint Grid: Paint current brush in grid layout on selected surface(s)"
- -c "PaintGrid"
- -dmc "performPaintGrid 2";// -i "iconName.xpm";
- menuItem -optionBox true -command "PaintGridOptions";
-
- menuItem -l "Paint Random"
- -annotation
- "Paint Random: Paint current brush in random layout on selected surface(s)"
- -c "PaintRandom"
- -dmc "performPaintRandom 2";// -i "iconName.xpm";
- menuItem -optionBox true -command "PaintRandomOptions";
-
- setParent -m ..;
-
- menuItem -d true;
- }
-
- menuItem -label "Paint Effects Globals..."
- -annotation "Paint Effects Globals: Edit global Paint Effects attributes"
- -command "PaintEffectsGlobalSettings";
-
- menuItem -label "Paint Effects Mesh Quality..."
- -annotation "Mesh Quality: Edit mesh quality attributes for selected stroke or paint effects mesh"
- -command "PaintEffectsMeshQuality";
-
- menuItem -l "Preset Blending" -cb false
- -annotation "Toggles Preset Blending"
- -command "checkPresetBlend" presetBlendMenu;
-
- menuItem -ecr false -optionBox 1
- -annotation "Preset Blending: Set mix-in levels for brush presets"
- -l "Preset Blending"
- -c "PresetBlendingWindow";
-
-
- menuItem -label "Save Brush Preset..."
- -annotation "Save Brush Preset: Save the settings of the template brush to current shelf or Visor directory"
- -command "SaveBrushPreset";
- }
- }
-
-